package com.dc.entity.special;


import com.dc.entity.ShipRepairEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;

/**
 * 0 船体下料  亚善-康帝
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "t_workflow_special_1_ship_cut")
public class WorkflowSpecial1ShipCutEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "ship_repair_id", columnDefinition = "bigint unsigned NOT NULL", insertable = false, updatable = false)
    private Long shipRepairId;      // 维修记录 外键id

    @Column(name = "submit_time")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date submitTime;        // 填写日期

    @Column(name = "ship_name", length = 50)
    private String shipName;        // 船体名称

    @Column(name = "reporter", length = 20)
    private String reporter;        // 填报人

    ////////////////////////////////////////////////////////////////////////////////////
    @Column(name = "component", length = 20)
    private String component;       // 部件

    @Column(name = "weight")
    private Double weight;          // 厚度(mm)

    @Column(name = "width")
    private Double width;           // 宽度(mm)

    @Column(name = "length")
    private Double length;          // 长度(mm)

    @Column(name = "num")
    private Integer num;            // 数量

    @Column(name = "area")
    private Double area;            // 下料面积(m²)

    @Column(name = "power_by_unit")
    private Double powerByUnit;     // 单位电能标定值

    @Column(name = "powers")
    private Double powers;          // 用电量

    @Column(name = "o2_by_unit")
    private Double o2ByUnit;        // 单位耗氧气量标定值

    @Column(name = "o2")
    private Double o2;              // 耗氧气量(m³)

    @Column(name = "air_by_unit")
    private Double airByUnit;       // 单位压缩空气标定值

    @Column(name = "airs")
    private Double airs;            // 耗压缩空气量(m³)

    ////////////////////////////////////////////

    @JsonIgnore
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ship_repair_id")
    private ShipRepairEntity shipRepairEntity;
}
